package com.example.shiwu;

import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.location.Address;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewStub;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.shiwu.db.model.BoxEight;
import com.example.shiwu.db.model.BoxFive;
import com.example.shiwu.db.model.BoxFour;
import com.example.shiwu.db.model.BoxNine;
import com.example.shiwu.db.model.BoxOne;
import com.example.shiwu.db.model.BoxSeven;
import com.example.shiwu.db.model.BoxSix;
import com.example.shiwu.db.model.BoxTen;
import com.example.shiwu.db.model.BoxThree;
import com.example.shiwu.db.model.BoxTwo;
import com.example.shiwu.db.model.Items;
import com.example.shiwu.service.BoxEightService;
import com.example.shiwu.service.BoxFiveService;
import com.example.shiwu.service.BoxFourService;
import com.example.shiwu.service.BoxNineService;
import com.example.shiwu.service.BoxOneService;
import com.example.shiwu.service.BoxSevenService;
import com.example.shiwu.service.BoxSixService;
import com.example.shiwu.service.BoxTenService;
import com.example.shiwu.service.BoxThreeService;
import com.example.shiwu.service.BoxTwoService;
import com.example.shiwu.service.ItemsService;
import com.example.shiwu.util.DateUtils;
import com.example.shiwu.util.LocationNewUtils;
import com.github.dfqin.grantor.PermissionListener;
import com.github.dfqin.grantor.PermissionsUtil;

import java.util.List;

public class GpsAddActivity extends AppCompatActivity {


    public ListView editSb;
    public TextView title_text, title_seting, did,
            box_one_val,box_two_val, box_three_val, box_four_val, box_five_val, box_six_val, box_seven_val, box_eight_val, box_nine_val, box_ten_val, box_eleven_val, box_twelve_val,
            boxtwo_one_val, boxtwo_two_val, boxtwo_three_val, boxtwo_four_val, boxtwo_five_val, boxtwo_six_val, boxtwo_seven_val, boxtwo_eight_val, boxtwo_nine_val, boxtwo_ten_val, boxtwo_eleven_val, boxtwo_twelve_val,
            boxthree_one_val, boxthree_two_val, boxthree_three_val, boxthree_four_val, boxthree_five_val, boxthree_six_val, boxthree_seven_val, boxthree_eight_val, boxthree_nine_val, boxthree_ten_val, boxthree_eleven_val, boxthree_twelve_val,
            boxfour_one_val, boxfour_two_val, boxfour_three_val, boxfour_four_val, boxfour_five_val, boxfour_six_val, boxfour_seven_val, boxfour_eight_val, boxfour_nine_val, boxfour_ten_val, boxfour_eleven_val, boxfour_twelve_val,
            boxfive_one_val, boxfive_two_val, boxfive_three_val, boxfive_four_val, boxfive_five_val, boxfive_six_val, boxfive_seven_val, boxfive_eight_val, boxfive_nine_val, boxfive_ten_val, boxfive_eleven_val, boxfive_twelve_val,
            boxsix_one_val, boxsix_two_val, boxsix_three_val, boxsix_four_val, boxsix_five_val, boxsix_six_val, boxsix_seven_val, boxsix_eight_val, boxsix_nine_val, boxsix_ten_val, boxsix_eleven_val, boxsix_twelve_val,
            boxseven_one_val, boxseven_two_val, boxseven_three_val, boxseven_four_val, boxseven_five_val, boxseven_six_val, boxseven_seven_val, boxseven_eight_val, boxseven_nine_val, boxseven_ten_val, boxseven_eleven_val, boxseven_twelve_val,
            boxeight_one_val, boxeight_two_val, boxeight_three_val, boxeight_four_val, boxeight_five_val, boxeight_six_val, boxeight_seven_val, boxeight_eight_val, boxeight_nine_val, boxeight_ten_val, boxeight_eleven_val, boxeight_twelve_val,
            boxnine_one_val, boxnine_two_val, boxnine_three_val, boxnine_four_val, boxnine_five_val, boxnine_six_val, boxnine_seven_val, boxnine_eight_val, boxnine_nine_val, boxnine_ten_val, boxnine_eleven_val, boxnine_twelve_val,
            boxten_one_val, boxten_two_val, boxten_three_val, boxten_four_val, boxten_five_val, boxten_six_val, boxten_seven_val, boxten_eight_val, boxten_nine_val, boxten_ten_val, boxten_eleven_val, boxten_twelve_val;
    private Button bt_box_one,bt_box_two,bt_box_three,bt_box_four,bt_box_five,bt_box_six,bt_box_seven,bt_box_eight,bt_box_nine,bt_box_ten,bt_box_eleven,bt_box_twelve;

    private Context myContent;
    private ViewStub viewStub1, viewStub2, viewStub3;
    public LocationNewUtils locationNewUtils;
    private TextView tv_show_foucs;
    private BoxOneService boxOneService;
    private BoxTwoService boxTwoService;
    private BoxThreeService boxThreeService;
    private BoxFourService boxFourService;
    private BoxFiveService boxFiveService;
    private BoxSixService boxSixService;
    private BoxSevenService boxSevenService;
    private BoxEightService boxEightService;
    private BoxNineService boxNineService;
    private BoxTenService boxTenService;
    private ItemsService itemsService;
    Items items = null;
    public ImageView title_back;
    //申请的权限
    private static final String[] mPermissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION};

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.gps_add_item);
        initbefore9box();
        initService();
        btInit();
        itemsService = new ItemsService();
        items = findSelectItem();
        //增加XML样式控件布局
        final LayoutInflater inflater = LayoutInflater.from(this);
        final LinearLayout scrollView = findViewById(R.id.box_add_child);
        Handler mhandler = new Handler();
        mhandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                //插入的布局
                @SuppressLint("ResourceType")
                LinearLayout layout2 = (LinearLayout) inflater.inflate(R.layout.gps_add_item_item, null).findViewById(R.id.box_add_item);
                scrollView.addView(layout2);
                initbehind3box();
                btLowInit();
            }
        }, 10);

        myContent = this;
        title_back = findViewById(R.id.title_back);
        title_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                GpsAddActivity.this.finish();
            }
        });
        saveBoxOneTest();
    }


    /**
     * 请求权限
     */
    private void requestPermissions() {
        if (PermissionsUtil.hasPermission(GpsAddActivity.this, mPermissions)) {
            //有访问权限
            initLocation();
        } else {
            PermissionsUtil.requestPermission(this, new PermissionListener() {
                @Override
                public void permissionGranted(@NonNull String[] permissions) {
                    //用户授予了访问权限
                    initLocation();
                }

                @Override
                public void permissionDenied(@NonNull String[] permissions) {
                    //用户拒绝了访问的申请
                    // initLocation();
                }
            }, mPermissions);
        }
    }

    /**
     * 加载位置
     */
    private void initLocation() {
        locationNewUtils.setAddressCallback(new LocationNewUtils.AddressCallback() {
            @Override
            public void onGetLocation(double lat, double lng) {
                tv_show_foucs.setText(lat + " - " + lng);
                locationNewUtils.cleareAddressCallback();
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //locationNewUtils.cleareAddressCallback();
    }
    private Items findSelectItem(){
        itemsService = new ItemsService();
        Items items = new Items();
        Items items1 = new Items();
        items.setStatus(1);
        List<Items> lis = null;

        try {
            lis = itemsService.getItems(items);
            items1 = lis.get(0);
        }catch (Exception e){
            e.printStackTrace();
        }
        return items1;
    }
    private void initService(){
        boxOneService = new BoxOneService();
        boxTwoService = new BoxTwoService();
        boxThreeService = new BoxThreeService();
        boxFourService = new BoxFourService();
        boxFiveService = new BoxFiveService();
        boxSixService = new BoxSixService();
        boxSevenService = new BoxSevenService();
        boxEightService = new BoxEightService();
        boxNineService = new BoxNineService();
        boxTenService = new BoxTenService();
    }

    private void btInit(){
        bt_box_one = findViewById(R.id.bt_box_one);
        bt_box_two = findViewById(R.id.bt_box_two);
        bt_box_three= findViewById(R.id.bt_box_three);
        bt_box_four = findViewById(R.id.bt_box_four);
        bt_box_five= findViewById(R.id.bt_box_five);
        bt_box_six = findViewById(R.id.bt_box_six);
        bt_box_seven = findViewById(R.id.bt_box_seven);
        bt_box_eight = findViewById(R.id.bt_box_eight);
        bt_box_nine= findViewById(R.id.bt_box_nine);

        bt_box_one.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxOne();
            }
        });

        bt_box_two.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxTwo();
            }
        });

        bt_box_three.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxThree();
            }
        });

        bt_box_four.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxFour();
            }
        });
        bt_box_five.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxFive();
            }
        });

        bt_box_six.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxSix();
            }
        });

        bt_box_seven.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxSeven();
            }
        });

        bt_box_eight.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxEight();
            }
        });

        bt_box_nine.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxNine();
            }
        });

    }

    private void btLowInit(){
        bt_box_ten = findViewById(R.id.bt_box_ten);

        bt_box_ten.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                saveBoxTen();
            }
        });
    }
    private void saveBoxOneTest(){
        BoxOne boxOne = new BoxOne();
        String oneLat = "123.3424-234234.45535";
        String twoLat = "123.3424-234234.45535";
        String threeLat = "123.3424-234234.45535";
        String fourLat = "123.3424-234234.45535";
        String fiveLat = "123.3424-234234.45535";
        String sixLat = "123.3424-234234.45535";
        String sevenLat = "123.3424-234234.45535";
        String eightLat = "123.3424-234234.45535";
        String nineLat = "123.3424-234234.45535";
        String tenLat = "123.3424-234234.45535";
        String elevenLat = "123.3424-234234.45535";
        String twelveLat = "123.3424-234234.45535";
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxOne.setItemId(items.getId().toString());
        boxOne.setBoxOneLat(oneLat);
        boxOne.setBoxTwoLat(twoLat);
        boxOne.setBoxThreeLat(threeLat);
        boxOne.setBoxFourLat(fourLat);
        boxOne.setBoxFiveLat(fiveLat);
        boxOne.setBoxSixLat(sixLat);
        boxOne.setBoxSevenLat(sevenLat);
        boxOne.setBoxEightLat(eightLat);
        boxOne.setBoxNineLat(nineLat);
        boxOne.setBoxTenLat(tenLat);
        boxOne.setBoxElevenLat(elevenLat);
        boxOne.setBoxTwelveLat(twelveLat);
        boxOne.setCreateTime(DateUtils.parseDate());

        Boolean oneBool = boxOneService.save(boxOne);
        if(oneBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxOne(){
        BoxOne boxOne = new BoxOne();
        String oneLat = box_one_val.getText().toString();
        String twoLat = box_two_val.getText().toString();
        String threeLat = box_three_val.getText().toString();
        String fourLat = box_four_val.getText().toString();
        String fiveLat = box_five_val.getText().toString();
        String sixLat = box_six_val.getText().toString();
        String sevenLat = box_seven_val.getText().toString();
        String eightLat = box_eight_val.getText().toString();
        String nineLat = box_nine_val.getText().toString();
        String tenLat = box_ten_val.getText().toString();
        String elevenLat = box_eleven_val.getText().toString();
        String twelveLat = box_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxOne.setItemId(items.getId().toString());
        boxOne.setBoxOneLat(oneLat);
        boxOne.setBoxTwoLat(twoLat);
        boxOne.setBoxThreeLat(threeLat);
        boxOne.setBoxFourLat(fourLat);
        boxOne.setBoxFiveLat(fiveLat);
        boxOne.setBoxSixLat(sixLat);
        boxOne.setBoxSevenLat(sevenLat);
        boxOne.setBoxEightLat(eightLat);
        boxOne.setBoxNineLat(nineLat);
        boxOne.setBoxTenLat(tenLat);
        boxOne.setBoxElevenLat(elevenLat);
        boxOne.setBoxTwelveLat(twelveLat);
        //boxOne.setCreateTime(DateUtils.parseDate());

        Boolean oneBool = boxOneService.saveOrUpdata(boxOne);
        if(oneBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxTwo(){
        BoxTwo boxTwo = new BoxTwo();
        boxTwo.setItemId(items.getId().toString());
        String oneLat = boxtwo_one_val.getText().toString();
        String twoLat = boxtwo_two_val.getText().toString();
        String threeLat = boxtwo_three_val.getText().toString();
        String fourLat = boxtwo_four_val.getText().toString();
        String fiveLat = boxtwo_five_val.getText().toString();
        String sixLat = boxtwo_six_val.getText().toString();
        String sevenLat = boxtwo_seven_val.getText().toString();
        String eightLat = boxtwo_eight_val.getText().toString();
        String nineLat = boxtwo_nine_val.getText().toString();
        String tenLat = boxtwo_ten_val.getText().toString();
        String elevenLat = boxtwo_eleven_val.getText().toString();
        String twelveLat = boxtwo_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxTwo.setBoxOneLat(oneLat);
        boxTwo.setBoxTwoLat(twoLat);
        boxTwo.setBoxThreeLat(threeLat);
        boxTwo.setBoxFourLat(fourLat);
        boxTwo.setBoxFiveLat(fiveLat);
        boxTwo.setBoxSixLat(sixLat);
        boxTwo.setBoxSevenLat(sevenLat);
        boxTwo.setBoxEightLat(eightLat);
        boxTwo.setBoxNineLat(nineLat);
        boxTwo.setBoxTenLat(tenLat);
        boxTwo.setBoxElevenLat(elevenLat);
        boxTwo.setBoxTwelveLat(twelveLat);
        //boxTwo.setCreateTime(DateUtils.parseDate());
        Boolean twoBool = boxTwoService.saveOrUpdata(boxTwo);
        if(twoBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxThree(){
        BoxThree boxThree = new BoxThree();
        boxThree.setItemId(items.getId().toString());
        String oneLat = boxthree_one_val.getText().toString();
        String twoLat = boxthree_two_val.getText().toString();
        String threeLat = boxthree_three_val.getText().toString();
        String fourLat = boxthree_four_val.getText().toString();
        String fiveLat = boxthree_five_val.getText().toString();
        String sixLat = boxthree_six_val.getText().toString();
        String sevenLat = boxthree_seven_val.getText().toString();
        String eightLat = boxthree_eight_val.getText().toString();
        String nineLat = boxthree_nine_val.getText().toString();
        String tenLat = boxthree_ten_val.getText().toString();
        String elevenLat = boxthree_eleven_val.getText().toString();
        String twelveLat = boxthree_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxThree.setBoxOneLat(oneLat);
        boxThree.setBoxTwoLat(twoLat);
        boxThree.setBoxThreeLat(threeLat);
        boxThree.setBoxFourLat(fourLat);
        boxThree.setBoxFiveLat(fiveLat);
        boxThree.setBoxSixLat(sixLat);
        boxThree.setBoxSevenLat(sevenLat);
        boxThree.setBoxEightLat(eightLat);
        boxThree.setBoxNineLat(nineLat);
        boxThree.setBoxTenLat(tenLat);
        boxThree.setBoxElevenLat(elevenLat);
        boxThree.setBoxTwelveLat(twelveLat);
        //boxThree.setCreateTime(DateUtils.parseDate());
        Boolean threeBool = boxThreeService.saveOrUpdata(boxThree);
        if(threeBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxFour(){
        BoxFour boxFour = new BoxFour();
        boxFour.setItemId(items.getId().toString());
        String oneLat = boxfour_one_val.getText().toString();
        String twoLat = boxfour_two_val.getText().toString();
        String threeLat = boxfour_three_val.getText().toString();
        String fourLat = boxfour_four_val.getText().toString();
        String fiveLat = boxfour_five_val.getText().toString();
        String sixLat = boxfour_six_val.getText().toString();
        String sevenLat = boxfour_seven_val.getText().toString();
        String eightLat = boxfour_eight_val.getText().toString();
        String nineLat = boxfour_nine_val.getText().toString();
        String tenLat = boxfour_ten_val.getText().toString();
        String elevenLat = boxfour_eleven_val.getText().toString();
        String twelveLat = boxfour_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxFour.setBoxOneLat(oneLat);
        boxFour.setBoxTwoLat(twoLat);
        boxFour.setBoxThreeLat(threeLat);
        boxFour.setBoxFourLat(fourLat);
        boxFour.setBoxFiveLat(fiveLat);
        boxFour.setBoxSixLat(sixLat);
        boxFour.setBoxSevenLat(sevenLat);
        boxFour.setBoxEightLat(eightLat);
        boxFour.setBoxNineLat(nineLat);
        boxFour.setBoxTenLat(tenLat);
        boxFour.setBoxElevenLat(elevenLat);
        boxFour.setBoxTwelveLat(twelveLat);
        //boxFour.setCreateTime(DateUtils.parseDate());
        Boolean fourBool = boxFourService.saveOrUpdata(boxFour);
        if(fourBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxFive(){
        BoxFive boxFive = new BoxFive();
        boxFive.setItemId(items.getId().toString());
        String oneLat = boxfive_one_val.getText().toString();
        String twoLat = boxfive_two_val.getText().toString();
        String threeLat = boxfive_three_val.getText().toString();
        String fourLat = boxfive_four_val.getText().toString();
        String fiveLat = boxfive_five_val.getText().toString();
        String sixLat = boxfive_six_val.getText().toString();
        String sevenLat = boxfive_seven_val.getText().toString();
        String eightLat = boxfive_eight_val.getText().toString();
        String nineLat = boxfive_nine_val.getText().toString();
        String tenLat = boxfive_ten_val.getText().toString();
        String elevenLat = boxfive_eleven_val.getText().toString();
        String twelveLat = boxfive_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxFive.setBoxOneLat(oneLat);
        boxFive.setBoxTwoLat(twoLat);
        boxFive.setBoxThreeLat(threeLat);
        boxFive.setBoxFourLat(fourLat);
        boxFive.setBoxFiveLat(fiveLat);
        boxFive.setBoxSixLat(sixLat);
        boxFive.setBoxSevenLat(sevenLat);
        boxFive.setBoxEightLat(eightLat);
        boxFive.setBoxNineLat(nineLat);
        boxFive.setBoxTenLat(tenLat);
        boxFive.setBoxElevenLat(elevenLat);
        boxFive.setBoxTwelveLat(twelveLat);
        //boxFive.setCreateTime(DateUtils.parseDate());
        Boolean fiveBool = boxFiveService.saveOrUpdata(boxFive);
        if(fiveBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxSix(){
        BoxSix boxSix = new BoxSix();
        boxSix.setItemId(items.getId().toString());
        String oneLat = boxsix_one_val.getText().toString();
        String twoLat = boxsix_two_val.getText().toString();
        String threeLat = boxsix_three_val.getText().toString();
        String fourLat = boxsix_four_val.getText().toString();
        String fiveLat = boxsix_five_val.getText().toString();
        String sixLat = boxsix_six_val.getText().toString();
        String sevenLat = boxsix_seven_val.getText().toString();
        String eightLat = boxsix_eight_val.getText().toString();
        String nineLat = boxsix_nine_val.getText().toString();
        String tenLat = boxsix_ten_val.getText().toString();
        String elevenLat = boxsix_eleven_val.getText().toString();
        String twelveLat = boxsix_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxSix.setBoxOneLat(oneLat);
        boxSix.setBoxTwoLat(twoLat);
        boxSix.setBoxThreeLat(threeLat);
        boxSix.setBoxFourLat(fourLat);
        boxSix.setBoxFiveLat(fiveLat);
        boxSix.setBoxSixLat(sixLat);
        boxSix.setBoxSevenLat(sevenLat);
        boxSix.setBoxEightLat(eightLat);
        boxSix.setBoxNineLat(nineLat);
        boxSix.setBoxTenLat(tenLat);
        boxSix.setBoxElevenLat(elevenLat);
        boxSix.setBoxTwelveLat(twelveLat);
        //boxSix.setCreateTime(DateUtils.parseDate());
        Boolean sixBool = boxSixService.saveOrUpdata(boxSix);
        if(sixBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxSeven(){
        BoxSeven boxSeven = new BoxSeven();
        boxSeven.setItemId(items.getId().toString());
        String oneLat = boxseven_one_val.getText().toString();
        String twoLat = boxseven_two_val.getText().toString();
        String threeLat = boxseven_three_val.getText().toString();
        String fourLat = boxseven_four_val.getText().toString();
        String fiveLat = boxseven_five_val.getText().toString();
        String sixLat = boxseven_six_val.getText().toString();
        String sevenLat = boxseven_seven_val.getText().toString();
        String eightLat = boxseven_eight_val.getText().toString();
        String nineLat = boxseven_nine_val.getText().toString();
        String tenLat = boxseven_ten_val.getText().toString();
        String elevenLat = boxseven_eleven_val.getText().toString();
        String twelveLat = boxseven_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxSeven.setBoxOneLat(oneLat);
        boxSeven.setBoxTwoLat(twoLat);
        boxSeven.setBoxThreeLat(threeLat);
        boxSeven.setBoxFourLat(fourLat);
        boxSeven.setBoxFiveLat(fiveLat);
        boxSeven.setBoxSixLat(sixLat);
        boxSeven.setBoxSevenLat(sevenLat);
        boxSeven.setBoxEightLat(eightLat);
        boxSeven.setBoxNineLat(nineLat);
        boxSeven.setBoxTenLat(tenLat);
        boxSeven.setBoxElevenLat(elevenLat);
        boxSeven.setBoxTwelveLat(twelveLat);
        //boxSeven.setCreateTime(DateUtils.parseDate());
        Boolean sevenBool = boxSevenService.saveOrUpdata(boxSeven);
        if(sevenBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxEight(){
        BoxEight boxEight = new BoxEight();
        boxEight.setItemId(items.getId().toString());
        String oneLat = boxeight_one_val.getText().toString();
        String twoLat = boxeight_two_val.getText().toString();
        String threeLat = boxeight_three_val.getText().toString();
        String fourLat = boxeight_four_val.getText().toString();
        String fiveLat = boxeight_five_val.getText().toString();
        String sixLat = boxeight_six_val.getText().toString();
        String sevenLat = boxeight_seven_val.getText().toString();
        String eightLat = boxeight_eight_val.getText().toString();
        String nineLat = boxeight_nine_val.getText().toString();
        String tenLat = boxeight_ten_val.getText().toString();
        String elevenLat = boxeight_eleven_val.getText().toString();
        String twelveLat = boxeight_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxEight.setBoxOneLat(oneLat);
        boxEight.setBoxTwoLat(twoLat);
        boxEight.setBoxThreeLat(threeLat);
        boxEight.setBoxFourLat(fourLat);
        boxEight.setBoxFiveLat(fiveLat);
        boxEight.setBoxSixLat(sixLat);
        boxEight.setBoxSevenLat(sevenLat);
        boxEight.setBoxEightLat(eightLat);
        boxEight.setBoxNineLat(nineLat);
        boxEight.setBoxTenLat(tenLat);
        boxEight.setBoxElevenLat(elevenLat);
        boxEight.setBoxTwelveLat(twelveLat);
        //boxEight.setCreateTime(DateUtils.parseDate());
        Boolean eightBool = boxEightService.saveOrUpdata(boxEight);
        if(eightBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxNine(){
        BoxNine boxNine = new BoxNine();
        boxNine.setItemId(items.getId().toString());

        String oneLat = boxnine_one_val.getText().toString();
        String twoLat = boxnine_two_val.getText().toString();
        String threeLat = boxnine_three_val.getText().toString();
        String fourLat = boxnine_four_val.getText().toString();
        String fiveLat = boxnine_five_val.getText().toString();
        String sixLat = boxnine_six_val.getText().toString();
        String sevenLat = boxnine_seven_val.getText().toString();
        String eightLat = boxnine_eight_val.getText().toString();
        String nineLat = boxnine_nine_val.getText().toString();
        String tenLat = boxnine_ten_val.getText().toString();
        String elevenLat = boxnine_eleven_val.getText().toString();
        String twelveLat = boxnine_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxNine.setBoxOneLat(oneLat);
        boxNine.setBoxTwoLat(twoLat);
        boxNine.setBoxThreeLat(threeLat);
        boxNine.setBoxFourLat(fourLat);
        boxNine.setBoxFiveLat(fiveLat);
        boxNine.setBoxSixLat(sixLat);
        boxNine.setBoxSevenLat(sevenLat);
        boxNine.setBoxEightLat(eightLat);
        boxNine.setBoxNineLat(nineLat);
        boxNine.setBoxTenLat(tenLat);
        boxNine.setBoxElevenLat(elevenLat);
        boxNine.setBoxTwelveLat(twelveLat);
        //boxNine.setCreateTime(DateUtils.parseDate());
        Boolean nineBool = boxNineService.saveOrUpdata(boxNine);
        if(nineBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }
    private void saveBoxTen(){
        BoxTen boxTen = new BoxTen();
        boxTen.setItemId(items.getId().toString());
        String oneLat = box_one_val.getText().toString();
        String twoLat = box_two_val.getText().toString();
        String threeLat = box_three_val.getText().toString();
        String fourLat = box_four_val.getText().toString();
        String fiveLat = box_five_val.getText().toString();
        String sixLat = box_six_val.getText().toString();
        String sevenLat = box_seven_val.getText().toString();
        String eightLat = box_eight_val.getText().toString();
        String nineLat = box_nine_val.getText().toString();
        String tenLat = box_ten_val.getText().toString();
        String elevenLat = box_eleven_val.getText().toString();
        String twelveLat = box_twelve_val.getText().toString();
        if(oneLat.equals("") && twoLat.equals("") && threeLat.equals("") && fourLat.equals("") && fiveLat.equals("") &&
                sixLat.equals("") && sevenLat.equals("") && eightLat.equals("") && nineLat.equals("") && tenLat.equals("") && elevenLat.equals("") && twelveLat.equals("")){
            Toast.makeText(GpsAddActivity.this, "必填项不能为空！", Toast.LENGTH_SHORT).show();
            return;
        }
        boxTen.setBoxOneLat(oneLat);
        boxTen.setBoxTwoLat(twoLat);
        boxTen.setBoxThreeLat(threeLat);
        boxTen.setBoxFourLat(fourLat);
        boxTen.setBoxFiveLat(fiveLat);
        boxTen.setBoxSixLat(sixLat);
        boxTen.setBoxSevenLat(sevenLat);
        boxTen.setBoxEightLat(eightLat);
        boxTen.setBoxNineLat(nineLat);
        boxTen.setBoxTenLat(tenLat);
        boxTen.setBoxElevenLat(elevenLat);
        boxTen.setBoxTwelveLat(twelveLat);
        //boxTen.setCreateTime(DateUtils.parseDate());
        Boolean tenBool = boxTenService.saveOrUpdata(boxTen);
        if(tenBool){
            Toast.makeText(GpsAddActivity.this, "提交成功！", Toast.LENGTH_SHORT).show();
        }
    }

    private void initbefore9box() {
        //------------------------box1----------------------
        box_one_val = findViewById(R.id.box_one_val);
        box_two_val = findViewById(R.id.box_two_val);
        box_three_val = findViewById(R.id.box_three_val);
        box_four_val = findViewById(R.id.box_four_val);
        box_five_val = findViewById(R.id.box_five_val);
        box_six_val = findViewById(R.id.box_six_val);
        box_seven_val = findViewById(R.id.box_seven_val);
        box_eight_val = findViewById(R.id.box_eight_val);
        box_nine_val = findViewById(R.id.box_nine_val);
        box_ten_val = findViewById(R.id.box_ten_val);
        box_eleven_val = findViewById(R.id.box_eleven_val);
        box_twelve_val = findViewById(R.id.box_twelve_val);
        //------------------------box2----------------------
        boxtwo_one_val = findViewById(R.id.boxtwo_one_val);
        boxtwo_two_val = findViewById(R.id.boxtwo_two_val);
        boxtwo_three_val = findViewById(R.id.boxtwo_three_val);
        boxtwo_four_val = findViewById(R.id.boxtwo_four_val);
        boxtwo_five_val = findViewById(R.id.boxtwo_five_val);
        boxtwo_six_val = findViewById(R.id.boxtwo_six_val);
        boxtwo_seven_val = findViewById(R.id.boxtwo_seven_val);
        boxtwo_eight_val = findViewById(R.id.boxtwo_eight_val);
        boxtwo_nine_val = findViewById(R.id.boxtwo_nine_val);
        boxtwo_ten_val = findViewById(R.id.boxtwo_ten_val);
        boxtwo_eleven_val = findViewById(R.id.boxtwo_eleven_val);
        boxtwo_twelve_val = findViewById(R.id.boxtwo_twelve_val);
        //------------------------box3----------------------
        boxthree_one_val = findViewById(R.id.boxthree_one_val);
        boxthree_two_val = findViewById(R.id.boxthree_two_val);
        boxthree_three_val = findViewById(R.id.boxthree_three_val);
        boxthree_four_val = findViewById(R.id.boxthree_four_val);
        boxthree_five_val = findViewById(R.id.boxthree_five_val);
        boxthree_six_val = findViewById(R.id.boxthree_six_val);
        boxthree_seven_val = findViewById(R.id.boxthree_seven_val);
        boxthree_eight_val = findViewById(R.id.boxthree_eight_val);
        boxthree_nine_val = findViewById(R.id.boxthree_nine_val);
        boxthree_ten_val = findViewById(R.id.boxthree_ten_val);
        boxthree_eleven_val = findViewById(R.id.boxthree_eleven_val);
        boxthree_twelve_val = findViewById(R.id.boxthree_twelve_val);
        //------------------------box4----------------------
        boxfour_one_val = findViewById(R.id.boxfour_one_val);
        boxfour_two_val = findViewById(R.id.boxfour_two_val);
        boxfour_three_val = findViewById(R.id.boxfour_three_val);
        boxfour_four_val = findViewById(R.id.boxfour_four_val);
        boxfour_five_val = findViewById(R.id.boxfour_five_val);
        boxfour_six_val = findViewById(R.id.boxfour_six_val);
        boxfour_seven_val = findViewById(R.id.boxfour_seven_val);
        boxfour_eight_val = findViewById(R.id.boxfour_eight_val);
        boxfour_nine_val = findViewById(R.id.boxfour_nine_val);
        boxfour_ten_val = findViewById(R.id.boxfour_ten_val);
        boxfour_eleven_val = findViewById(R.id.boxfour_eleven_val);
        boxfour_twelve_val = findViewById(R.id.boxfour_twelve_val);
        //------------------------box5----------------------
        boxfive_one_val = findViewById(R.id.boxfive_one_val);
        boxfive_two_val = findViewById(R.id.boxfive_two_val);
        boxfive_three_val = findViewById(R.id.boxfive_three_val);
        boxfive_four_val = findViewById(R.id.boxfive_four_val);
        boxfive_five_val = findViewById(R.id.boxfive_five_val);
        boxfive_six_val = findViewById(R.id.boxfive_six_val);
        boxfive_seven_val = findViewById(R.id.boxfive_seven_val);
        boxfive_eight_val = findViewById(R.id.boxfive_eight_val);
        boxfive_nine_val = findViewById(R.id.boxfive_nine_val);
        boxfive_ten_val = findViewById(R.id.boxfive_ten_val);
        boxfive_eleven_val = findViewById(R.id.boxfive_eleven_val);
        boxfive_twelve_val = findViewById(R.id.boxfive_twelve_val);
        //------------------------box6----------------------
        boxsix_one_val = findViewById(R.id.boxsix_one_val);
        boxsix_two_val = findViewById(R.id.boxsix_two_val);
        boxsix_three_val = findViewById(R.id.boxsix_three_val);
        boxsix_four_val = findViewById(R.id.boxsix_four_val);
        boxsix_five_val = findViewById(R.id.boxsix_five_val);
        boxsix_six_val = findViewById(R.id.boxsix_six_val);
        boxsix_seven_val = findViewById(R.id.boxsix_seven_val);
        boxsix_eight_val = findViewById(R.id.boxsix_eight_val);
        boxsix_nine_val = findViewById(R.id.boxsix_nine_val);
        boxsix_ten_val = findViewById(R.id.boxsix_ten_val);
        boxsix_eleven_val = findViewById(R.id.boxsix_eleven_val);
        boxsix_twelve_val = findViewById(R.id.boxsix_twelve_val);
        //------------------------box7----------------------
        boxseven_one_val = findViewById(R.id.boxseven_one_val);
        boxseven_two_val = findViewById(R.id.boxseven_two_val);
        boxseven_three_val = findViewById(R.id.boxseven_three_val);
        boxseven_four_val = findViewById(R.id.boxseven_four_val);
        boxseven_five_val = findViewById(R.id.boxseven_five_val);
        boxseven_six_val = findViewById(R.id.boxseven_six_val);
        boxseven_seven_val = findViewById(R.id.boxseven_seven_val);
        boxseven_eight_val = findViewById(R.id.boxseven_eight_val);
        boxseven_nine_val = findViewById(R.id.boxseven_nine_val);
        boxseven_ten_val = findViewById(R.id.boxseven_ten_val);
        boxseven_eleven_val = findViewById(R.id.boxseven_eleven_val);
        boxseven_twelve_val = findViewById(R.id.boxseven_twelve_val);
        //------------------------box8----------------------
        boxeight_one_val = findViewById(R.id.boxeight_one_val);
        boxeight_two_val = findViewById(R.id.boxeight_two_val);
        boxeight_three_val = findViewById(R.id.boxeight_three_val);
        boxeight_four_val = findViewById(R.id.boxeight_four_val);
        boxeight_five_val = findViewById(R.id.boxeight_five_val);
        boxeight_six_val = findViewById(R.id.boxeight_six_val);
        boxeight_seven_val = findViewById(R.id.boxeight_seven_val);
        boxeight_eight_val = findViewById(R.id.boxeight_eight_val);
        boxeight_nine_val = findViewById(R.id.boxeight_nine_val);
        boxeight_ten_val = findViewById(R.id.boxeight_ten_val);
        boxeight_eleven_val = findViewById(R.id.boxeight_eleven_val);
        boxeight_twelve_val = findViewById(R.id.boxeight_twelve_val);
        //------------------------box9----------------------
        boxnine_one_val = findViewById(R.id.boxnine_one_val);
        boxnine_two_val = findViewById(R.id.boxnine_two_val);
        boxnine_three_val = findViewById(R.id.boxnine_three_val);
        boxnine_four_val = findViewById(R.id.boxnine_four_val);
        boxnine_five_val = findViewById(R.id.boxnine_five_val);
        boxnine_six_val = findViewById(R.id.boxnine_six_val);
        boxnine_seven_val = findViewById(R.id.boxnine_seven_val);
        boxnine_eight_val = findViewById(R.id.boxnine_eight_val);
        boxnine_nine_val = findViewById(R.id.boxnine_nine_val);
        boxnine_ten_val = findViewById(R.id.boxnine_ten_val);
        boxnine_eleven_val = findViewById(R.id.boxnine_eleven_val);
        boxnine_twelve_val = findViewById(R.id.boxnine_twelve_val);

        // -----------------------------box1-----------------------
        box_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_one_val;
                requestPermissions();
            }
        });

        box_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_two_val;
                requestPermissions();
            }
        });

        box_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_three_val;
                requestPermissions();
            }
        });

        box_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_four_val;
                requestPermissions();
            }
        });

        box_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_five_val;
                requestPermissions();
            }
        });

        box_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_six_val;
                requestPermissions();
            }
        });

        box_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_seven_val;
                requestPermissions();
            }
        });

        box_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_eight_val;
                requestPermissions();
            }
        });

        box_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_nine_val;
                requestPermissions();
            }
        });

        box_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_ten_val;
                requestPermissions();
            }
        });

        box_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_eleven_val;
                requestPermissions();
            }
        });

        box_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = box_twelve_val;
                requestPermissions();
            }
        });

        // -----------------------------box2-----------------------
        boxtwo_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_one_val;
                requestPermissions();
            }
        });

        boxtwo_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_two_val;
                requestPermissions();
            }
        });

        boxtwo_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_three_val;
                requestPermissions();
            }
        });

        boxtwo_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_four_val;
                requestPermissions();
            }
        });

        boxtwo_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_five_val;
                requestPermissions();
            }
        });

        boxtwo_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_six_val;
                requestPermissions();
            }
        });

        boxtwo_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_seven_val;
                requestPermissions();
            }
        });

        boxtwo_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_eight_val;
                requestPermissions();
            }
        });

        boxtwo_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_nine_val;
                requestPermissions();
            }
        });

        boxtwo_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_ten_val;
                requestPermissions();
            }
        });

        boxtwo_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_eleven_val;
                requestPermissions();
            }
        });

        boxtwo_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxtwo_twelve_val;
                requestPermissions();
            }
        });


        // -----------------------------box3-----------------------
        boxthree_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_one_val;
                requestPermissions();
            }
        });

        boxthree_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_two_val;
                requestPermissions();
            }
        });

        boxthree_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_three_val;
                requestPermissions();
            }
        });

        boxthree_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_four_val;
                requestPermissions();
            }
        });

        boxthree_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_five_val;
                requestPermissions();
            }
        });

        boxthree_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_six_val;
                requestPermissions();
            }
        });

        boxthree_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_seven_val;
                requestPermissions();
            }
        });

        boxthree_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_eight_val;
                requestPermissions();
            }
        });

        boxthree_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_nine_val;
                requestPermissions();
            }
        });

        boxthree_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_ten_val;
                requestPermissions();
            }
        });

        boxthree_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_eleven_val;
                requestPermissions();
            }
        });

        boxthree_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxthree_twelve_val;
                requestPermissions();
            }
        });

        // -----------------------------box4-----------------------
        boxfour_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_one_val;
                requestPermissions();
            }
        });

        boxfour_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_two_val;
                requestPermissions();
            }
        });

        boxfour_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_three_val;
                requestPermissions();
            }
        });

        boxfour_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_four_val;
                requestPermissions();
            }
        });

        boxfour_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_five_val;
                requestPermissions();
            }
        });

        boxfour_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_six_val;
                requestPermissions();
            }
        });

        boxfour_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_seven_val;
                requestPermissions();
            }
        });

        boxfour_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_eight_val;
                requestPermissions();
            }
        });

        boxfour_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_nine_val;
                requestPermissions();
            }
        });

        boxfour_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_ten_val;
                requestPermissions();
            }
        });

        boxfour_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_eleven_val;
                requestPermissions();
            }
        });

        boxfour_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfour_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box5-----------------------
        boxfive_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_one_val;
                requestPermissions();
            }
        });

        boxfive_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_two_val;
                requestPermissions();
            }
        });

        boxfive_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_three_val;
                requestPermissions();
            }
        });

        boxfive_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_four_val;
                requestPermissions();
            }
        });

        boxfive_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_five_val;
                requestPermissions();
            }
        });

        boxfive_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_six_val;
                requestPermissions();
            }
        });

        boxfive_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_seven_val;
                requestPermissions();
            }
        });

        boxfive_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_eight_val;
                requestPermissions();
            }
        });

        boxfive_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_nine_val;
                requestPermissions();
            }
        });

        boxfive_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_ten_val;
                requestPermissions();
            }
        });

        boxfive_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_eleven_val;
                requestPermissions();
            }
        });

        boxfive_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxfive_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box6-----------------------
        boxsix_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_one_val;
                requestPermissions();
            }
        });

        boxsix_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_two_val;
                requestPermissions();
            }
        });

        boxsix_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_three_val;
                requestPermissions();
            }
        });

        boxsix_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_four_val;
                requestPermissions();
            }
        });

        boxsix_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_five_val;
                requestPermissions();
            }
        });

        boxsix_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_six_val;
                requestPermissions();
            }
        });

        boxsix_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_seven_val;
                requestPermissions();
            }
        });

        boxsix_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_eight_val;
                requestPermissions();
            }
        });

        boxsix_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_nine_val;
                requestPermissions();
            }
        });

        boxsix_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_ten_val;
                requestPermissions();
            }
        });

        boxsix_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_eleven_val;
                requestPermissions();
            }
        });

        boxsix_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxsix_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box7-----------------------
        boxseven_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_one_val;
                requestPermissions();
            }
        });

        boxseven_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_two_val;
                requestPermissions();
            }
        });

        boxseven_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_three_val;
                requestPermissions();
            }
        });

        boxseven_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_four_val;
                requestPermissions();
            }
        });

        boxseven_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_five_val;
                requestPermissions();
            }
        });

        boxseven_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_six_val;
                requestPermissions();
            }
        });

        boxseven_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_seven_val;
                requestPermissions();
            }
        });

        boxseven_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_eight_val;
                requestPermissions();
            }
        });

        boxseven_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_nine_val;
                requestPermissions();
            }
        });

        boxseven_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_ten_val;
                requestPermissions();
            }
        });

        boxseven_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_eleven_val;
                requestPermissions();
            }
        });

        boxseven_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxseven_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box6-----------------------
        boxeight_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_one_val;
                requestPermissions();
            }
        });

        boxeight_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_two_val;
                requestPermissions();
            }
        });

        boxeight_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_three_val;
                requestPermissions();
            }
        });

        boxeight_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_four_val;
                requestPermissions();
            }
        });

        boxeight_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_five_val;
                requestPermissions();
            }
        });

        boxeight_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_six_val;
                requestPermissions();
            }
        });

        boxeight_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_seven_val;
                requestPermissions();
            }
        });

        boxeight_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_eight_val;
                requestPermissions();
            }
        });

        boxeight_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_nine_val;
                requestPermissions();
            }
        });

        boxeight_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_ten_val;
                requestPermissions();
            }
        });

        boxeight_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_eleven_val;
                requestPermissions();
            }
        });

        boxeight_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxeight_twelve_val;
                requestPermissions();
            }
        });
        // -----------------------------box6-----------------------
        boxnine_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_one_val;
                requestPermissions();
            }
        });

        boxnine_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_two_val;
                requestPermissions();
            }
        });

        boxnine_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_three_val;
                requestPermissions();
            }
        });

        boxnine_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_four_val;
                requestPermissions();
            }
        });

        boxnine_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_five_val;
                requestPermissions();
            }
        });

        boxnine_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_six_val;
                requestPermissions();
            }
        });

        boxnine_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_seven_val;
                requestPermissions();
            }
        });

        boxnine_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_eight_val;
                requestPermissions();
            }
        });

        boxnine_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_nine_val;
                requestPermissions();
            }
        });

        boxnine_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_ten_val;
                requestPermissions();
            }
        });

        boxnine_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_eleven_val;
                requestPermissions();
            }
        });

        boxnine_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxnine_twelve_val;
                requestPermissions();
            }
        });

    }

    private void initbehind3box() {
        boxten_one_val = findViewById(R.id.boxten_one_val);
        boxten_two_val = findViewById(R.id.boxten_two_val);
        boxten_three_val = findViewById(R.id.boxten_three_val);
        boxten_four_val = findViewById(R.id.boxten_four_val);
        boxten_five_val = findViewById(R.id.boxten_five_val);
        boxten_six_val = findViewById(R.id.boxten_six_val);
        boxten_seven_val = findViewById(R.id.boxten_seven_val);
        boxten_eight_val = findViewById(R.id.boxten_eight_val);
        boxten_nine_val = findViewById(R.id.boxten_nine_val);
        boxten_ten_val = findViewById(R.id.boxten_ten_val);
        boxten_eleven_val = findViewById(R.id.boxten_eleven_val);
        boxten_twelve_val = findViewById(R.id.boxten_twelve_val);

        boxten_one_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_one_val;
                requestPermissions();
            }
        });
        boxten_two_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_two_val;
                requestPermissions();
            }
        });
        boxten_three_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_three_val;
                requestPermissions();
            }
        });
        boxten_four_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_four_val;
                requestPermissions();
            }
        });
        boxten_five_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_five_val;
                requestPermissions();
            }
        });
        boxten_six_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_six_val;
                requestPermissions();
            }
        });
        boxten_seven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_seven_val;
                requestPermissions();
            }
        });
        boxten_eight_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_eight_val;
                requestPermissions();
            }
        });
        boxten_nine_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_nine_val;
                requestPermissions();
            }
        });
        boxten_ten_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_ten_val;
                requestPermissions();
            }
        });
        boxten_eleven_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_eleven_val;
                requestPermissions();
            }
        });
        boxten_twelve_val.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                locationNewUtils = null;
                locationNewUtils = LocationNewUtils.getInstance(GpsAddActivity.this);
                tv_show_foucs = boxten_twelve_val;
                requestPermissions();
            }
        });
    }
}